package com.gin.no_gay_alliance.fragment.user.tab;

import android.os.Bundle;

import androidx.viewbinding.ViewBinding;

import com.gin.no_gay_alliance.exception.RequireParamException;
import com.gin.no_gay_alliance.fragment.base.BaseBindingFragment;
import com.gin.no_gay_alliance.viewmodel.UserInfoModel;

/**
 * 用户中心tab父类
 *
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/9/6 16:59
 **/
public abstract class BaseUserCenterTabFragment<T extends ViewBinding> extends BaseBindingFragment<T> {
    public static final String ARG_USER_INFO = "user_info";
    protected UserInfoModel userInfoModel;

    /**
     * 获取和处理参数
     *
     * @param arguments 参数
     */
    @Override
    protected final void handleArguments(Bundle arguments) {
        userInfoModel = arguments.getParcelable(ARG_USER_INFO);
        if (userInfoModel == null) {
            throw new RequireParamException();
        }
    }
}
